#!/usr/bin/python
# -*- coding: UTF-8 -*-
# 爬取http://finance.eastmoney.com/news/cywjh.html关键字结果页面
import requests
from bs4 import BeautifulSoup
req=requests.get('http://finance.eastmoney.com/news/cywjh.html')
bs=BeautifulSoup(req.content,'html.parser')
p_title=bs.find_all('p',attrs={'class':'title'})
for info in p_title:
    url=info.a.get('href')
    req=requests.get(url)
    bs1=BeautifulSoup(req.content,'html.parser')
    title=bs1.find('h1')
    p_all=bs1.find_all('p')
    print title